package com.gu.schedule;

import com.gu.controller.DataController;
import com.gu.untils.DateUtils;
import org.springframework.scheduling.annotation.Scheduled;
import org.springframework.stereotype.Component;

import javax.annotation.Resource;
import java.util.Date;

/**
 * Description: 定时器任务；
 *
 * @Autor: Rolin
 * datetime: 06-24-15:02
 */
@Component
public class ScheduleTask {

   @Resource
   private DataController dataController ;

   @Scheduled(cron = "0 0 1 * * ?")
   public void schedule(){
      String dateTime = DateUtils.formatDate(DateUtils.addDays(new Date(),-1));
      dataController.getStatistics(dateTime);
   }

}
